﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Facade.Interface;
using Common.Business;
using Common.Core.Data;
using Common.Entity;

namespace Common.Facade.Presenter
{
    public class AchieveEditPresenter<B, M> : EditPresenter
        where B : IBLLClass
        where M : IModelBase
    {
        public new IEdit<M> ViewModel { get; set; }
        
        public override void RegistrBLLClass()
        {
            BLLClass = default(B);
        }

        public override void ControlBind(IModelBase model)
        {
            ViewModel.Bind((M)model);
        }

        public override IModelBase GetModelByClient()
        {
            return ViewModel.GetModel();
        }

        public override IModelBase GetModel(IModelBase key)
        {
            return BLLClass.GetModel(key);
        }

        public void Save()
        {
            M m = ViewModel.GetModel();
        }
    }
}
